import 'package:flutter/material.dart';

class DrawerPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        children: <Widget>[
          UserAccountsDrawerHeader(
              //用户账号DrawerHeader
              accountName: Text(
                "James",
                style: TextStyle(color: Colors.black26, fontSize: 20.0),
              ),
              accountEmail: Text(
                "952121091@qq.com",
                style: TextStyle(color: Colors.black26, fontSize: 20.0),
              ),
              currentAccountPicture: CircleAvatar(
                //圆形用户头像
                backgroundImage: NetworkImage(
                    "https://gss0.bdstatic.com/-4o3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D268%3Bg%3D0/sign=1d2dd2fe5f4e9258a63481e8a4b9b665/a8ec8a13632762d0e30d9e25a9ec08fa513dc67c.jpg"),
              ),
              decoration: BoxDecoration(
                  image: DecorationImage(
                      image: NetworkImage(
                          "http://img0.imgtn.bdimg.com/it/u=1486826859,4031998705&fm=200&gp=0.jpg"),
                      fit: BoxFit.cover, //填充整个框
                      colorFilter: ColorFilter.mode(
                          //滤镜效果
                          Colors.yellow[100].withOpacity(0.7),
                          BlendMode.hardLight)))),
          ListTile(
            onTap: () => Navigator.pop(context),
            title: Text("Message", textAlign: TextAlign.right),
            trailing: Icon(
              Icons.message,
              color: Colors.black12,
              size: 22.0,
            ),
          ),
          ListTile(
            onTap: () => Navigator.pop(context),
            title: Text("Favorite", textAlign: TextAlign.right),
            trailing: Icon(
              Icons.favorite,
              color: Colors.black12,
              size: 22.0,
            ),
          ),
          ListTile(
            onTap: () => Navigator.pop(context),
            title: Text("Setting", textAlign: TextAlign.right),
            trailing: Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
          )
        ],
      ),
    );
  }
}
